class Solution {
    public int[] twoSum(int[] nums, int target) {
        int index1 = 0;
        int index2 = 0;
        for (int i = 0; i < nums.length; i++) {
            int num1 = nums[i];
            int num2 = target - num1;
            index1 = i;
            for (int j = i + 1; j < nums.length; j++) {
                int num3 = nums[j];
                if (num2 == num3) {
                    index2 = j;
                }
            }
            if (index2 != 0) {
                break;
            }
        }

        return new int[]{index1, index2};
    }
}
